import { EventEmitter } from 'events';
const myEmitter = new EventEmitter();
function greetHandler(name) {
  console.log('Hello ' + name);
 }
 function goodbyeHandler(name) {
  console.log('Goodbye ' + name);
 }
 myEmitter.on('error', (err) => {
  console.log('An Error Occured:', err);
 });
 myEmitter.emit('error', new Error('Something went wrong'));